package com.luyi.sensor.dao.sensor;

import com.luyi.sensor.entity.Sensor;
import com.luyi.sensor.entity.SensorRecord;
import com.luyi.sensor.vo.SensorVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * SensorMapper mapper层
 * author: luyi
 * time: 2022/1/7 21:26
 */
@Repository
public interface SensorBootMapper{

    // 新增传感器
    void addSensor(Sensor sensor) ;
    // ID 查询
    Sensor selectById (@Param("id") Integer id) ;
    //获取最大ID TODO :
//    Sensor findMaxByType(String type);
    
    /**
     * 查询所有数据
     * @return
     */
//    @Select("select * from sensor")
//    List<Sensor> list();

//    @Results({
//            @Result(property = "sensor_01", column = "sensor_01"),
//            @Result(property = "update_time", column = "update_time"),
////            @Result(property = "password", column = "PASSWORD"),
////            @Result(property = "mobileNum", column = "PHONE_NUM")
//    })

    /**
     * 根据ID查询
     */
//    @Select("select * from sensor where sensor_01 = #{id} limit 1")
//    Sensor getSensorById(float sensorId);


    //根据名称模糊查询
    List<Sensor> likeName(String name);
    //根据某个Id查询
    Sensor getBySensorId(long sensor_id);

    List<SensorVO> getAllSensor();


//    String getBySensorName(String sensor_name);

}
